﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>麦包郎</title>
		<meta name="description" content="麦包郎" />
		<meta name="keywords" content="麦包郎"/>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<link rel="stylesheet" href="css/amazeui.min.css" />
		<link rel="stylesheet" href="css/style.css" />
		<script type="text/javascript" src="js/jquery.min.js" ></script>
		





		<script src="js/jquery.min.js"></script>
		<script src="js/mobiscroll_002.js" type="text/javascript"></script>
		<script src=js/mobiscroll_004.js" type="text/javascript"></script>
		<link href="css/mobiscroll_002.css" rel="stylesheet" type="text/css">
		<link href="css/mobiscroll.css" rel="stylesheet" type="text/css">
		<script src="js/mobiscroll.js" type="text/javascript"></script>
		<script src="js/mobiscroll_003.js" type="text/javascript"></script>
		<script src="js/mobiscroll_005.js" type="text/javascript"></script>
		<link href="css/mobiscroll_003.css" rel="stylesheet" type="text/css">

	

  </head>
  
  <body>
    <header data-am-widget="header" class="am-header am-header-default header">
		  <div class="am-header-left am-header-nav">
		     <a href="<%=basePath %>commodity/findAll" class="">
		       <i class="am-header-icon am-icon-angle-left"></i>
		     </a>
		  </div>
		  <h1 class="am-header-title"> <a href="#right-link" class="" style="color: #333;">购物车</a></h1>
		  <div class="am-header-right am-header-nav">
		     <a href="#right-link" class=""> </a>
		  </div>
	  </header>
		<div class="cate-search" style="position: relative; top: 0; border-bottom: 0;">
	    	<!--<input type="text" class="cate-input" placeholder="搜索全部订单">-->
	    	<input type="button" class="cate-btn">
	    </div>
	    <!--<ul class="order-style">-->
	    	<!--<li class="current"><a href="">全部</a></li>-->
	    	<!--<li><a href="">待付款</a></li>-->
	    	<!--<li><a href="">待收货</a></li>-->

	    	<!--<li><a href="">取消订单</a></li>-->
	    <!--</ul>-->
	    <c:forEach items="${shangMap}" var="shang">
	    <c:if test="${!empty shang.value}">
	    <div class="c-comment">
			<span class="c-comment-num">订单编号：NO${shang.key}</span>
			<span class="c-comment-suc">待确认</span>

		</div>
		<div class="c-comment-list" style="border: 0;">
		<c:forEach items="${shang.value}" var="sa">
		
		
		
			<c:if test="${0!=sa.num}">
			<a class="o-con" >
            	<div class="o-con-img"><img src="<%=basePath %>${sa.image}"></div>
                <div class="o-con-txt">
                	<p>${sa.name }</p>
                	<p class="price">￥${sa.price}</p>
                	<p>合计：<span>￥<fmt:formatNumber type="number" value="${sa.price*sa.num}" maxFractionDigits="1"/></span></p>
                </div>
            	<div class="o-con-much"> <h4>x${sa.num}</h4></div>
            	
            </a>
            </c:if>
            

            </c:forEach>
            <div style="margin-top: 20px"   class="c-com-money"><span>送达时间 ：</span> 
          <input value=""  readonly="readonly" name="appDateTime" id="time${shang.key}" class="appDateTime"  type="text">
		


								</div>

		</div>
		
		<div class="c-com-btn">

			<a id="que"  onclick="ti(${shang.key})">确认订单</a>
			<a href="<%=basePath %>ord/qu?ordId=${shang.key}">取消订单</a>
		</div>
		<div class="clear"></div>
		</c:if>
		</c:forEach>
		<script type="text/javascript">
			function ti(ordId){
	        	var time=$("#time"+ordId+"").val();
	        	window.location.href="ord/endOrd?id="+ordId+"&time="+time;
	        }
		</script>
  </body>
  <script type="text/javascript">
var date = new Date(); 
  var seperator1 = "-"; 
  var seperator2 = ":"; 
  var month = date.getMonth() + 1; 
  var strDate = date.getDate(); 
  if (month >= 1 && month <= 9) { 
      month = "0" + month; 
  } 
  if (strDate >= 0 && strDate <= 9) { 
      strDate = "0" + strDate; 
  } 
  
  var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate 
          + " " + date.getHours() + seperator2 + date.getMinutes(); 
$('.appDateTime').val(currentdate);
        $(function () {
            var currYear = (new Date()).getFullYear();
            var opt={};
            opt.date = {preset : 'date'};
            opt.datetime = {preset : 'datetime'};
            opt.time = {preset : 'time'};
            opt.default = {
                theme: 'android-ics light', //皮肤样式
                display: 'modal', //显示方式
                mode: 'scroller', //日期选择模式
                dateFormat: 'yyyy-mm-dd',
                lang: 'zh',
                showNow: true,
                nowText: "今天",
                startYear: currYear - 10, //开始年份
                endYear: currYear + 10 //结束年份
            };

//            $("#appDate").mobiscroll($.extend(opt['date'], opt['default']));
            var optDateTime = $.extend(opt['datetime'], opt['default']);
            var optTime = $.extend(opt['time'], opt['default']);
            $(".appDateTime").mobiscroll(optDateTime).datetime(optDateTime);
            $("#appTime").mobiscroll(optTime).time(optTime);
        });
	</script>
  
</html>
